﻿Imports BUS
Imports DTO
Public Class frmTHONGTINKHACHHANG

    Private Sub frmTHONGTINKHACHHANG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DBNGKDataSet2.KHACHHANG' table. You can move, or remove it, as needed.
        LoadDskh()
    End Sub

    Dim khbus As KhachHangBUS = New KhachHangBUS
    Private Sub LoadDskh()
        Dim dt As DataTable = New DataTable
        dt = khbus.LoaddsKH()
        dgv_khachhang.DataSource = dt
    End Sub

    Private Sub GroupPanel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupPanel1.Click

    End Sub

    Private Sub cbb_makh_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbb_makh.SelectedIndexChanged
        Dim makh As Integer
        makh = CType(cbb_makh.SelectedValue, Integer)
        Dim khbus As New KhachHangBUS
        dgv_khachhang.DataSource = khbus.LoaddsKHTheoMA(makh)
    End Sub

    Private Sub btn_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_thoat.Click
        Me.Close()
    End Sub
End Class